import React from 'react'
import {HashRouter as Router,Route,Switch} from  "react-router-dom"
import  info from  "../components";

export default function index({list}:any) {
  return (
        <Router>
              <Switch>
                  {list.length?<Route path="/main/" exact component={info[list[0].component]}></Route>:""}
          
                  {list.map((item:any)=>{
                      return   <Route key={item.id} path={item.path} component={info[item.component]}></Route>
                  })}
                </Switch>  
        </Router>
  )
}
